<template>
  <div>
    <p>use value and @change</p>
    <CloudTimePicker :value="value" @change="onChange" />
    <br />
    <br />
    <p>v-model</p>
    <CloudTimePicker v-model="value" />
    <br />
    <br />
    <p>Do not change</p>
    <CloudTimePicker :value="value2" />
  </div>
</template>

<script>
  import moment from 'moment';
  export default {
    title: '9.受控组件 ',
    subTitle: 'value 和 onChange 需要配合使用。也可以直接使用v-model。',
    data () {
      return {
        value: null,
        value2: moment(),
      }
    },
    methods: {
      onChange (time) {
        console.log(time);
        this.value = time;
      },
    }
  }
</script>

<style lang="scss">
</style>